package com.example.demo.controller;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.example.demo.annotation.SensitiveWordCheck;
import com.example.demo.entity.dto.TestDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("test")
public class TestController {


    @SensitiveWordCheck
    @PostMapping("/add")
    public Boolean add(@RequestBody TestDTO dto){
        log.info(JSONUtil.toJsonStr(dto));
        return true;
    }
}
